package com.jcms.cms.manager.parcel.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jcms.cms.dao.parcel.OrderDao;
import com.jcms.cms.entity.parcel.Order;
import com.jcms.cms.manager.parcel.OrderManager;
import com.jcms.common.page.Pagination;

@Service
@Transactional
public class OrderManagerImpl implements OrderManager {

	@Autowired
	private OrderDao dao;

	public OrderDao getDao() {
		return dao;
	}

	public void setDao(OrderDao dao) {
		this.dao = dao;
	}

	public int save(Order order) {
		return dao.save(order);
	}

	public List<Order> getOrdersByUser(Integer id) {
		return dao.getOrdersByUser(id);
	}

	public Pagination getPage(int pageNo, int pageSize) {
		return dao.getPage(pageNo, pageSize);
	}

	public Order getOrderById(Integer id) {
		return dao.getOrderById(id);
	}

	public void updateOrder(Order order) {
		dao.updateOrder(order);
	}
}
